
import request from '@/utils/request'

export function fetchDepart() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}
// 获取部门负责人
export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple',
    method: 'GET'
  })
}
// 新增部门
export function getaddment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// 获取部门详情
export function fetchred(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'GET'
  })
}
// 修改部门详情
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

/**
 * @description: 删除部门
 * @param {*} id 当前点击的操作按钮 所在的项的id
 * @return {*}
 */
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
